Security: Fix Local privilege escalation via DLL hijack#46145
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens per-machine custom install locations to mitigate a local privilege escalation vector where permissive inherited ACLs allow non-admin users to plant DLLs in a directory that is added to PATH.
Changes:
- Adds a new deferred, non-impersonated MSI custom action to secure the install folder ACL for per-machine installs outside Program Files.
- Implements ACL templating based on Program Files and reapplies hardened ACLs across the existing install tree during upgrade/repair.
- Wires the new custom action into the WiX installer sequencing for per-machine scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| installer/PowerToysSetupVNext/Product.wxs | Schedules the new SecureInstallFolderAcl custom action and its property setup for per-machine installs. |
| installer/PowerToysSetupCustomActionsVNext/pch.h | Adds ACL API header include needed for the new security logic. |
| installer/PowerToysSetupCustomActionsVNext/CustomAction.def | Exports the new custom action entrypoint for MSI to invoke. |
| installer/PowerToysSetupCustomActionsVNext/CustomAction.cpp | Implements the install-folder ACL hardening + recursive re-ACL logic. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nto dev/vanzue/fix-sec
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
DHowett
requested changes
Mar 16, 2026
Member
DHowett
left a comment
There was a problem hiding this comment.
why does this require hundreds of lines of custom action code? does WiX not support ACLs?
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
Thanks @DHowett Would you help take a look again see if this is a correct fix? |
DHowett
approved these changes
Mar 17, 2026
Member
DHowett
left a comment
There was a problem hiding this comment.
This looks like it could be correct. Can you add a comment to the WXS file explaining the meaning of the SDDL string?
Contributor
Author
|
Done, thanks!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Attack vector:
The fix is to:
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
After upgrade, the ACL:
Path : Microsoft.PowerShell.Core\FileSystem::C:\apps\Power Toys\DSCModules
Owner : NT AUTHORITY\SYSTEM
Group : NT AUTHORITY\SYSTEM
Access : CREATOR OWNER Allow 268435456
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
BUILTIN\Users Allow ReadAndExecute, Synchronize
Audit :
Sddl : O:SYG:SYD:P(A;OICIIO;GA;;;CO)(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)